from sqlalchemy import select
from app.api.admin.model.shop.shop import ShopModel
from app.api.h5.schema.shop.shop import ShopOutSchema
from app.dependencies.database import db


class ShopService():
    async def info(self):
        res = await db.fetch_one(select(ShopModel))
        return ShopOutSchema.model_validate(res, from_attributes=True).model_dump(by_alias=True)

    @classmethod
    async def instance(cls):
        return cls()
